import request from '@/utils/request'

// 分页查询我的日报
export function myDailyReport(query) {
  return request({
    url: '/api/admin/dailyReport/myDailyReport',
    method: 'get',
    params: query
  })
}

// 根据Client查询专案
export function getProjectByClient(query) {
  return request({
    url: '/api/admin/project/getProjectByClient',
    method: 'get',
    params: query
  })
}
// 根据Client查询需求
export function getDemandByClient(query) {
  return request({
    url: '/api/admin/demand/getDemandByClient',
    method: 'get',
    params: query
  })
}

export function queryClient(clientName) {
  return request({
    url: '/api/admin/customer/queryClient',
    method: 'get',
    params: clientName
  })
}

// 最近一次日报
export function queryPreDaily(clientName) {
  return request({
    url: '/api/admin/dailyReport/queryPreDaily',
    method: 'get',
    params: clientName
  })
}

// 查询日报详情
export function queryDetail(clientName) {
  return request({
    url: '/api/admin/dailyReport/queryDetail',
    method: 'get',
    params: clientName
  })
}

// 获取下次日报日期及上次日报内容,计划日报
export function getPre(query) {
  return request({
    url: '/api/admin/dailyReport/getPre?dateStr=' + query,
    method: 'get'
  })
}

// 日报提交
export function save(data) {
  return request({
    url: '/api/admin/dailyReport/save',
    method: 'post',
    data
  })
}

// 日报提交
export function getNextDay(params) {
  return request({
    url: '/api/admin/dailyReport/getNextDay',
    method: 'get',
    params
  })
}

export function queryPlan() {
  return request({
    url: '/api/admin/dailyReport/queryPlanByCreate',
    method: 'get'
  })
}

// GET /dailyReport/myManageDailyReport  查询我管理下的日报

export function myManageDailyReport(clientName) {
  return request({
    url: '/api/admin/dailyReport/myManageDailyReport',
    method: 'get',
    params: clientName
  })
}


export function myManageDailyCountReport(clientName) {
  return request({
    url: '/api/admin/dailyReport/myManageDailyCountReport',
    method: 'get',
    params: clientName
  })
}

export function queryDailyHrsReport(data) {
  return request({
    url: '/api/admin/dailyReport/queryDailyHrsReport',
    method: 'get',
    params: data
  })
}

/**
 * 导出专编人员工时
 * 查询员工
 * 入参名称：
 */
export function exportDailyHrsProjectReport(list, createBy, year) {
  return '/api/admin/excel/exportDailyHrsProjectReport?list=' + encodeURI(encodeURI(JSON.stringify(list)))
  + '&createBy=' + createBy + '&year=' + year;
}

/**
 * 导出Bu人员工时
 * 查询员工
 * 入参名称：
 */
export function exportDailyHrsBuReport(list, createBy, year) {
  return '/api/admin/excel/exportDailyHrsBuReport?list=' + encodeURI(encodeURI(JSON.stringify(list)))
  + '&createBy=' + createBy + '&year=' + year;
}


